<template>
	<!-- 临床招募 -->
	<view class="clinical_recruitment">
		<web-header :select_name="'clinical_recruitment'" @itemClick="itemClick"></web-header>

		<view class="content_template">
			<view class="content_left" style="">
				<view class="h5_content">
					<!-- 标题模板 -->
					<view class="header_title  ">
						<view class="header">
							<view class="title">临床招募</view>
							<!-- <image src="/static/2.1/btn_more.png"></image> -->
						</view>
						<view class="line"></view>
					</view>
					<view v-if="data_list.length == 0" class="header_title">
						暂无数据
					</view>
					<view class=" " v-for="(item,index) in data_list">
						<view  @click='openinfo(item)'>
							<clinical-recruitment-cell :item='item'></clinical-recruitment-cell>
						</view>
						<view v-if="index == 2">
							<image class="ad_01" src="/static/2.2/ad_01.png"></image>
						</view>
						<!-- <view class="clinical_recruitment_cell" @click='openinfo(item)'>
							<view class="text_content">
								{{item.title}}
							</view>
							<view class="line">
								<view class="text1 text_color_green">招募城市</view>
								<view class="text2 text_color_dark">{{item.cityName}}</view>
								<view class="text3 text_color_dark">{{item.numberOfPeople}}人</view>
							</view>
							<view class="line">
								<view class="text1 text_color_green">线组</view>
								<view class="text2 text_color_dark">{{item.lineName}}</view>
								<view class="text3 text_color_green">入组人数</view>
							</view>
						</view>
						<view class="h5_line"></view> -->
					</view>
				</view>
			</view>
			<view class="content_right">
				<filtrate-card @itemClick="itemClick"></filtrate-card>
			</view>

		</view>
		<!-- <view class="title">
			{{details.title}}
		</view>
		
		<view class="content" >
			<view class=" back_btn" @click="back()"> 返回上级</view>
			 <view v-html="details.content"></view>
			 
			 <view class="  createDate">{{details.createDate}} </view>
		</view> -->
		<page-pagination style="margin-bottom: 60rpx;" @change="page_change" :currentPage='page.current'
			:total="page.total" color="#048597" :showAround="true" :btnText="true" :forceEllipses="true">
		</page-pagination>
		
		<image class="ad_02" src="/static/2.2/ad_02.png"></image>
		

		<web-foot></web-foot>
	</view>
</template>

<script>
	import web_header from '@/components/web-header.vue'
	import web_foot from '@/components/web-foot.vue'
	//右侧筛选卡片
	import filtrate_card from '@/components/filtrate_card.vue'

	export default {

		components: {
			'web-header': web_header,
			'web-foot': web_foot,
			'filtrate-card': filtrate_card

		},
		data() {
			return {
				data_list: [],
				page: {
					total: 88,
					size: 10,
					current: 1
				},
				select_type: ''
			}
		},
		onLoad(e) {
			this.id = e.id
			this.loadData()
			var that = this;


		},
		methods: {
			back() {
				uni.navigateBack({

				})
			},
			itemClick(item) {
				console.log(item)
				this.select_type = item.id

				this.loadData()
			},
			page_change(currentPage, type) {
				this.page.current = currentPage
				this.loadData()
				// this.page.currentPage = currentPage;
				console.log("点击了" + type + "，当前页：" + currentPage);
			},
			loadData(select_type) {
				var that = this;
				this.service("/website/clinicalRecruitmentList", 'get', {
					page: that.page.current,
					pageSize: 10,
					type: this.select_type
				}).then(res => {
					console.log(res)


					that.data_list = res.data.records
					// that.hot_page += 1;
					console.log(res)
					that.page = res.data



					// this.hot = res.data.records;
					uni.stopPullDownRefresh();
				})
			},
			//详情
			openinfo(item) {
				uni.navigateTo({
					url: '/pages/clinical_recruitment/clinical_recruitment_info?id=' + item.id
				})
			},

		}
	}
</script>

<style lang="scss">
	@import './clinical_recruitment.scss'
</style>
